package rad.framework.validator;

import java.lang.annotation.Annotation;
import java.util.regex.Matcher;
import java.util.regex.Pattern;

/**
 * @author Chunyun Zhao
 */
public class StrongPasswordValidator extends AbstractStringValidator {
	Pattern pattern;
	
	public void initialize(Annotation annotation) {
		 pattern = Pattern.compile("[0-9!@#$%^&*()]");
	}

	public boolean validate(String value) {
		if ( value.length() < 6 ) {
			return false;
		}
		
		Matcher matcher = pattern.matcher(value);
		return matcher.find();
	}	
}
